Note. Boxplots display the interquartile range (IQR, center box), and the whiskers extend 1.5*IQR from the lower and upper hinge. The white point indicates the mean and the white center line indicates the median.




Data Preparation

In an initial preparatory step, we import the data into the R project environment and prepare the variables for further processing and later analyses.

Data Import

The data were collected using two different survey tools. For the study with sojourners (Study 1: worker) we used the survey platform Qualtrics XM, whereas the studies with international students (Study 2: student), and the international medical professionals (Study 3: medical) were conducted using the survey framework FormR. This means that the datasets had inconsistent file formats and naming conventions. For the Qualtrics study we pre-processed some variables to ease the import process (for the syntax files see the SPS files in ‘data/S1_Workers/processed/cleaned’ and for the raw data files see ‘data/S1_Workers/raw’). For the two other studies, we import the raw csv files from their respective folders.

# Load variable name lookup table
varNames <- readxl::read_excel("preregistration/varNames.xlsx")

# rename function
reNam <- function(data = NA, names = varNames, study = "S1", survey = "pre") {
  # for testing
  # data = dtS1$raw.pre
  # names = varNames
  # study = "S1"
  # survey = "pre"
  
  var <- paste0("survey", study)
  varNamOld <- paste0("varNam", study)
  
  nameTbl <- names %>%
    filter((!!sym(var)) == survey) %>%
    select(varNam, varNamOld = (!!sym(varNamOld)))
  
  data.table::setnames(data, as.character(nameTbl$varNamOld), as.character(nameTbl$varNam), skip_absent=TRUE)
  
  return(data)
}

# workers
# initial data cleaning was done in SPSS (syntax files are available in "")
dtS1 <- list(
  raw.pre = read_spss("data/S1_Workers/processed/cleaned/MT - Pre-Measure - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "pre"),
  raw.post = read_spss("data/S1_Workers/processed/cleaned/MT - Post-Measure - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "post"),
  raw.morning = read_spss("data/S1_Workers/processed/cleaned/MT - Morning - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "daily"),
  raw.afternoon = read_spss("data/S1_Workers/processed/cleaned/MT - Afternoon - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "daily")
)

# students
dtS2 <- list(
  raw.pre = read.csv(file = "data/S2_Students/raw/AOTS_Pre.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "pre"),
  raw.post = read.csv(file = "data/S2_Students/raw/AOTS_Post.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "post"),
  raw.daily = read.csv(file = "data/S2_Students/raw/AOTS_Daily.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "daily")
)

# young medical professionals
dtS3 <- list(
  raw.eligibility = read.csv("data/S3_Medical/raw/AOTM_Eligibility.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "pre_entry"), # works but should be 'survey = "pre_elig"'
  raw.pre = read.csv("data/S3_Medical/raw/AOTM_Pre.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "pre_entry"),
  raw.post = read.csv("data/S3_Medical/raw/AOTM_Post.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "post"),
  raw.daily = read.csv("data/S3_Medical/raw/AOTM_Daily.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "daily")
)


# # FROM INITIAL VAR NAME EXPORT [LEGACY]
# # export var names
# S1Nam <- rbind(
#   data.frame(
#     study = "S1",
#     survey = "pre",
#     varNam = names(dtS1$raw.pre)
#   ),
#   data.frame(
#     study = "S1",
#     survey = "daily",
#     varNam = names(dtS1$raw.afternoon)
#   ),
#   data.frame(
#     study = "S1",
#     survey = "post",
#     varNam = names(dtS1$raw.post)
#   )
# )
# S2Nam <- rbind(
#   data.frame(
#     study = "S2",
#     survey = "pre",
#     varNam = names(dtS2$raw.pre)
#   ),
#   data.frame(
#     study = "S2",
#     survey = "daily",
#     varNam = names(dtS2$raw.daily)
#   ),
#   data.frame(
#     study = "S2",
#     survey = "post",
#     varNam = names(dtS2$raw.post)
#   )
# )
# S3Nam <- rbind(
#   data.frame(
#     study = "S3",
#     survey = "pre_elig",
#     varNam = names(dtS3$raw.eligibility)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "pre_entry",
#     varNam = names(dtS3$raw.pre)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "daily",
#     varNam = names(dtS3$raw.daily)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "post",
#     varNam = names(dtS3$raw.post)
#   )
# )
# write.csv(
#   x = rbind(
#     S1Nam,
#     S2Nam,
#     S3Nam
#   ),
#   file = "preregistration/varNames.csv"
# )

Data Cleaning & Data Exclusions

Worker

For the sojourner sample data was collected in four separate surveys: (1) the pre-measurement, (2) the daily morning survey, (3) the daily afternoon survey, as well as (4) a post-measurement. We combine the four individual surveys into one cohesive dataframe and drop superfluous variables that are not relevant to the analyses relevant here. We then format the time and date variables and add person- and measurement indices (for easy and meaningful addressing of the data). We also exclude our own test data.
Note: All data preparation steps are saved in the ‘dtS1’ list.

# Create reduced data sets for morning and afternoon
dat.mo <- dtS1$raw.morning %>%
  select(-starts_with("t_"))
#setdiff(names(dtS1$raw.morning), names(dat.mo))
dat.mo$daytime <- "morning"

dat.af <- dtS1$raw.afternoon %>%
  select(-starts_with("t_"))
dat.af$daytime <- "afternoon"

# merge morning and afternoon measurements with indicator [+ clean up]
daily.dat <- plyr::rbind.fill(dat.mo, dat.af)
daily.dat <- daily.dat[daily.dat$last_outside_referrer != 55951, ]
dtS1$daily <- daily.dat
rm(dat.mo, dat.af, daily.dat)

# reduced data set for pre measurement
dat.pre.red <- dtS1$raw.pre %>%
  select(-starts_with("t_"))
names(dat.pre.red) <- paste(names(dat.pre.red), "pre", sep = ".")

# merge with daily data [+ clean up]
df.pre <- merge(
  x = dtS1$daily,
  y = dat.pre.red,
  by.x = "last_outside_referrer",
  by.y = "platformId.pre",
  all = T
)

# adjust duplicate names to fit to indicate daily or pre measurement
names(df.pre) <- gsub("[[:punct:]]x", ".daily", names(df.pre))
names(df.pre) <- gsub("[[:punct:]]y", ".pre", names(df.pre))

# reduced data set for post-measurement
dat.post.red <- dtS1$raw.post %>%
  select(-starts_with("t_"))
names(dat.post.red) <- paste(names(dat.post.red), "post", sep = ".")

# merge post measurement with pre- and daily data
df <- merge(
  x = df.pre,
  y = dat.post.red,
  by.x = "last_outside_referrer",
  by.y = "last_outside_referrer.post",
  all = T
)

# adjust duplicate names to indicate pre or post
names(df) <- gsub("[[:punct:]]x", ".pre", names(df))
names(df) <- gsub("[[:punct:]]y", ".post", names(df))

# add to list
dtS1$combined <- df
rm(df, df.pre, dat.post.red, dat.pre.red)

# create data frame with cleaned data
df <- dtS1$combined %>%
  filter(
    Finished.pre == 1,
    Finished == 1,
    !is.na(last_outside_referrer)
  )

# add running number as measurement ID within participants
df$measureID <- data.table::rowidv(df, cols = c("last_outside_referrer"))

df <- df %>%
  mutate(
    PID = as.numeric(factor(last_outside_referrer)),
    # participant ID
    TID = measureID - 1,
    # time ID with t0 = 0 for meaningfull intercept interpretations
    date = substr(created, 1, 10),
    # awkward way of extracting date (best converted to )
    time = substr(created, 12, 19),
    # awkward way of extracting time
    daynum = as.numeric(factor(dateQualtrics)),
    # all days as numeric for ordering
    daycor = ifelse(
      daytime == "morning" &
        period_to_seconds(hms(time)) < period_to_seconds(hms("12:00:00")) |
        daytime == "afternoon" &
          period_to_seconds(hms(time)) < period_to_seconds(hms("19:00:00")),
      daynum - 1,
      daynum
    ),
    # correctly identify which date the questionnaire is about
    daycor.lead = sprintf("%02d", daycor),
    daytime.lt = ifelse(daytime == "morning", "a", "b"),
    # morning / afternoon to a / b
    day_time = paste(daycor.lead, daytime.lt, sep = "_"),
    # combine day id with morning / afternoon
    ResponseId = as.numeric(factor(day_time)),
    # day and time identifier as numeric id
    SubTime = chron::times(time.0),
    time.daily = as.character(time),
    PPDate = as.Date(df$dateQualtrics),
    number = replace_na(ContactNum, 0),
    NonDutchNum = replace_na(NonDutchNum, 0)
  )

dtS1$clean <- df

# clean up
rm(df)

# Export reduced Data
# write.csv(dtS1$clean, "data/processed/MT_clean-merged_07-05-2018.csv", row.names = F)
# save(dtS1$clean, file = "data/processed/MT_clean-merged_07-05-2018.RData")

Student

For the student sample data was, similarly, collected in three separate surveys: (1) the pre-measurement, (2) the daily survey sent out at lunch and dinner time, and (3) a post-measurement. We combine the three individual surveys into one large dataframe and drop superfluous variables that are not relevant to the analyses relevant here. We exclude our own test data as well as one participant who entered the study twice (but gave different responses during the pre-measurement). We also reformat missing values and format core ID variables.
Note: All data preparation steps are saved in the ‘dtS2’ list.

# our own test IDs
ownIDs <- c(
  "beautifulLionfishXXXR5rcgVBzGu8hPvOqrK8UBJBw4owvi9nfRFSFu3lMzYhE",
  "niceDogoXXXmB8JI5SFu78SF3DVof84mGUPPNUr14p2HYFTtp31a6D1OwAzM6F-K",
  "amusedQuailXXXmhuc_fpTp8vPkMwDH1BzjaH1d1kHSO1bsPEfsnaEYk4WeVBfPi",
  "juwGAbtXX0_1kmZtSVqKh3PGaHOICqUyU4iBkrT3nDsI_uifuD1gzKcZerxaM5FL"
)

# Prepare dfs for Cleaning
df.pre <- dtS2$raw.pre %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!is.na(ended)) %>% # remove all who did not finish
  filter(!email %in% .$email[duplicated(.$email)]) %>% # remove all who did the pre questionnaire multiple times (b/c inconsistent ratings scales)
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.pre) <- paste(names(df.pre), "pre", sep = ".")

df.post <- dtS2$raw.post %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!is.na(ResponseId)) %>% # remove own test runs
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  filter(!is.na(ended)) %>% # remove all who never finished
  filter(!ResponseId %in% .$ResponseId[duplicated(.$ResponseId)]) %>% # remove all duplicate ResponseIds
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.post) <- paste(names(df.post), "post", sep = ".")

df.daily <- dtS2$raw.daily %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  filter(!is.na(ended)) %>% # remove all who never finished
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)

# merge daily with pre
dfPreDaily <- merge(
  x = df.daily,
  y = df.pre,
  by.x = "ResponseId",
  by.y = "ResponseId.pre", 
  suffixes = c(".daily", ".pre"),
  all = FALSE
)

# merge daily with post
dfCombined <- merge(
  x = dfPreDaily,
  y = df.post,
  by.x = "ResponseId",
  by.y = "ResponseId.post", 
  suffixes = c(".pre", ".post"),
  all = FALSE
)

# add to list
dtS2$clean <- dfCombined

# clean up workspace
rm(df.pre, df.daily, df.post, dfPreDaily, dfCombined, ownIDs)

Medical

For the medical professionals sample data was, again, collected in three separate surveys: (1) the pre-measurement, (2) the daily survey sent out at lunch and dinner time, and (3) a post-measurement. We combine the three individual surveys into one large dataframe. We exclude our own test data. We also reformat missing values and format core ID variables.
Note: All data preparation steps are saved in the ‘dtS3’ list.

# our own test IDs
ownIDs <- c(
  "test_LeonieXXXSklxecPLW0-FBPM4796o3pUwUhAY5jb9KGw8jQsKxWmGpa1Jiy", 
  "test_MaxXXXtOp_5dTNefIq0yKXtXt2IN6eEKxeHoPY9mlyvdsqPpLp1B0NGg4UL",
  "test_JannisXXXBsNqk62fOpX6chbd2tMWPptUdjjnhAqnQ3uBqckZ7gLIEoPlfZ",
  "quaintLeopardCatXXXAJ9cfSj-_SZLwNwMDxv_xv_iyr1Bg5YFLTlYdrjW0UXZY",
  "blue-eyedIndianElephantXXXLf5zPMpQCDGS3umFzIj-YVky7ivTItvvozW49m"
)

# Prepare dfs for Cleaning
df.pre <- dtS3$raw.pre %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!is.na(ended)) %>% # remove all who did not finish
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.pre) <- paste(names(df.pre), "pre", sep = ".")

df.post <- dtS3$raw.post %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>% 
  filter(!is.na(ResponseId)) %>% # remove own test runs
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  #filter(!is.na(ended)) %>% # remove all who never finished [disabled because only relevant if data is missing]
  filter(!ResponseId %in% .$ResponseId[duplicated(.$ResponseId)]) %>% # remove all duplicate ResponseIds
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.post) <- paste(names(df.post), "post", sep = ".")

df.daily <- dtS3$raw.daily %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  #filter(!is.na(ended)) %>% # remove all who never finished [disabled because only relevant if data is missing]
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)

# merge daily with pre
dfPreDaily <- merge(
  x = df.daily,
  y = df.pre,
  by.x = "ResponseId",
  by.y = "ResponseId.pre", 
  suffixes = c(".daily", ".pre"),
  all = F
)

# merge daily with post
dfCombined <- merge(
  x = dfPreDaily,
  y = df.post,
  by.x = "ResponseId",
  by.y = "ResponseId.post", 
  suffixes = c(".pre", ".post"),
  all = F
)

# add to list
dtS3$clean <- dfCombined

# clean up workspace
rm(df.pre, df.daily, df.post, dfPreDaily, dfCombined, ownIDs)

Calculate needed transformations

Worker

For the worker sample, the data transformation stage had three main aims:

  1. We first corrected time indicators within the surveys. In some cases participants completed their daily diary surveys for the afternoon after midnight. In these cases the measurement still is in reference to the previous day and is indicated in the corrected variable.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS1$clean

# Time and Date Variables
# remove seconds from afternoon time
df$SubTime[df$daytime == "afternoon"] <- paste0(substring(as.character(df$time.0[df$daytime == "afternoon"]), 4, 8), ":00")
df$time.daily[df$daytime == "afternoon" &
  !is.na(df$time.daily != "<NA>")] <- paste0(substring(as.character(df$time.daily[df$daytime == "afternoon" &
  !is.na(df$time.daily != "<NA>")]), 4, 8), ":00")

# Correct morning / afternoon date where survey was collected the day after to indicate the correct date that was targeted
df$PPDate[df$SubTime < "11:50:00" &
  df$daytime == "morning"] <- df$PPDate[df$SubTime < "11:50:00" &
  df$daytime == "morning"] - 1
df$PPDate[df$SubTime < "18:50:00" &
  df$daytime == "afternoon"] <- df$PPDate[df$SubTime < "18:50:00" &
  df$daytime == "afternoon"] - 1

# Make time IDs consistent with later studies
df$TID <- paste(df$PPDate, str_to_title(df$daytime))
df$TIDnum <- as.numeric(factor(df$TID %>% gsub(" Morning", "-A", .) %>% gsub(" Afternoon", "-B", .)))

df <- df %>%
  rowwise() %>%
  mutate(
    InteractionDum = sum(IntergroupContact, IngroupContact, na.rm = FALSE),
    InteractionDum = if_else(InteractionDum > 0, 1, InteractionDum),
    alertness = sum(alertness1, alertness2, na.rm = TRUE),
    calmness = sum(calmness1, calmness2, na.rm = TRUE),
    valence = sum(valence1, valence2, na.rm = TRUE)
  ) %>%
  ungroup()

# Need scales
df$keyMotiveFulfilled <- rowSums(df[, c("KeyNeedFulfillment", "DaytimeNeedFulfillment")], na.rm = T)
df$autonomy.daily.all <- rowSums(df[, c("autonomy_Int", "autonomy_NoInt")], na.rm = T)
df$competence.daily.all <- rowSums(df[, c("competence_Int", "competence_NoInt")], na.rm = T)
# cor(df$relatednessOther, df$relatedness_self_1,use="complete.obs")
df$relatedness.daily.all <- rowMeans(df[, c(
  "relatednessOther",
  "relatednessSelf",
  "relatednessNoInteraction"
)], na.rm = T)

pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatedness <- rowMeans(df[, c("relatednessOther", "relatednessSelf")], na.rm = T)

df$autonomy <- df$autonomy.daily.all
df$competence <- df$competence.daily.all
df$relatedness <- df$relatedness.daily.all

# summarize by participant (check that everything is within pp might not be the case for )
between <- df %>%
  group_by(last_outside_referrer) %>%
  mutate(
    CtContactNL = sum(IntergroupContact),
    CtContactNonNl = sum(IngroupContact),
    CtContactNLAll = sum(ContactNum),
    CtContactNonNlAll = sum(NonDutchNum),
    AvKeyNeed = mean(keyMotiveFulfilled, na.rm = T),
    AvKeyNeedInt = mean(KeyNeedFulfillment, na.rm = T),
    AvKeyNeedNoInt = mean(DaytimeNeedFulfillment, na.rm = T),
    AvAutonomy = mean(autonomy, na.rm = T),
    AvCompetence = mean(competence, na.rm = T),
    AvRelatedness = mean(relatedness, na.rm = T),
    AvThermo = mean(AttitudesDutch, na.rm = T),
    AvWB = mean(exWB, na.rm = T)
  ) %>%
  ungroup() %>%
  mutate(
    CtContactNL_c = scale(CtContactNL, scale = FALSE),
    AvKeyNeedInt_c = scale(AvKeyNeedInt, scale = FALSE),
    AvKeyNeed_c = scale(AvKeyNeed, scale = FALSE),
    CtContactNL_z = scale(CtContactNL, scale = TRUE),
    AvKeyNeedInt_z = scale(AvKeyNeedInt, scale = TRUE),
    AvKeyNeed_z = scale(AvKeyNeed, scale = TRUE)
  )

warning(
  "some variable transformations (esp. _c and _z) might be across all participants (i.e., not within PP). See next step."
)

dtS1$full <- between
rm(df, between)

# dataframe where interaction types are recoded
workerInteractionType <- dtS1$full %>%
  mutate(
    OutgroupInteraction = as_factor(IntergroupContact),
    NonOutgroupInteraction = as_factor(IngroupContact)
  )

# Create variables centered and standardized within Participant
# i.e., divide into trait and state
workerWithinBetween <-
  MlTraitState(
    data = workerInteractionType,
    id = "PID",
    selection =
      c(
        "keyMotiveFulfilled",
        "competence",
        "autonomy",
        "relatedness",
        "AttitudesDutch",
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatednessNoInteraction", 
        "qualityOverall", 
        "OutgroupInteraction",
        "NonOutgroupInteraction"
      )
  )

workerOutWithinBetween <-
  MlTraitState(
    data = workerInteractionType %>% filter(OutgroupInteraction == "Yes"),
    id = "PID",
    selection =
      c(
        "keyMotiveFulfilled",
        "AttitudesDutch",
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness", 
        "qualityOverall"
      )
  )


# Between participants contact frequency
workerContactFreq <- dtS1$full %>%
  group_by(PID) %>%
  summarise(
    n = n(),
    SumContactNL = sum(IntergroupContact),
    PercContactNL = SumContactNL / n * 100,
    SumContactNLAll = sum(number),
    AvAttitude = mean(AttitudesDutch, na.rm = T)
  ) %>%
  mutate(
    WinSumContactNL = DescTools::Winsorize(SumContactNL),
    WinSumContactNLAll = DescTools::Winsorize(SumContactNLAll)
  )

# save cleaned data
# save(df.btw, file = "data/processed/df.btw.RData")
# write_sav(df.btw, "data/processed/MT_clean-merged_pre-post.sav")

# export data to Mplus
# df.mplus = remove_all_labels(select(df,
#                                     PID, ResponseId,
#                                     thermometerDutch_1, inNonDutch, Contact_dum,
#                                     keyMotiveFulfilled, autonomy.daily.all, competence.daily.all, relatedness.daily.all))
# names(df.mplus)= c("PID", "ResponseId", "att", "intin", "intout", "keymot", "aut", "comp", "rel")
# mplus = df.mplus[order(df.mplus$PID, df.mplus$ResponseId),]
# mplus.intcont = mplus[mplus$intout==1,]
# prepareMplusData(mplus.intcont, "data/processed/dynamic-subset-intonly.dat")

Student

For the student sample, the data transformation stage had five main aims:

  1. We first create person, survey type, and measurement ID variables.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. We add information about the interaction partner to the beep during which a person was selected as an interaction partner.
  4. We cluster mean-center key variables within participants.
  5. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS2$clean

# Add ID variables
df$PID <- as.numeric(factor(df$ResponseId)) # participant ID

# order time
df$TID <- factor(df$date_period, levels = unique(dtS2$raw.daily$date_period))
df$TIDnum <- as.numeric(df$TID) # get numeric TID

# check whether time ordering worked
df <- df %>%
  arrange(PID, TID) # %>%
# View()

# Interaction as Factor
df$interaction.f <-
  factor(df$Interaction,
    levels = c("no interaction", "Dutch", "Non-Dutch")
  )
df$intNL <- ifelse(df$Interaction == "Dutch", 1, 0)
df$intNonNL <- ifelse(df$Interaction == "Non-Dutch", 1, 0)

df$IntergroupContact <- (df$IntergroupContact-2)*-1

# -------------------------------------------------------------------------------------------------------------
#                                       Combine Variables
# -------------------------------------------------------------------------------------------------------------
# Relatedness
pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatednessInteraction <- rowMeans(df[c("relatednessSelf", "relatednessOther")], na.rm = TRUE)
df$relatednessInteraction[df$relatednessInteraction == "NaN"] <- NA
# Relatedness Overall (JANNIS NOT SURE THESE ARE CORRECT, CHANGE ROWS?; J: Changed "NaN" in df$RelatednessInteraction to NA() should work now)
df$relatedness <-
  rowMeans(df[, c("relatednessInteraction", "relatednessNoInteraction")],
           na.rm = TRUE) %>%
  ifelse(is.nan(.), NA, .)

# Core Need
df$DaytimeNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)] <-
  df$KeyNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedFullfillment <- NA 
df$InteractionNeedFullfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)] <- 
  df$KeyNeedFulfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)]


# Pro-Sociality
df$ProSo <-
  rowMeans(df[, c("ProSo1", "ProSo2", "ProSo3", "ProSo4")], na.rm = T)
# Anti-Sociality
df$AntiSo <-
  rowMeans(df[, c("AntiSo1", "AntiSo2", "AntiSo3", "AntiSo4")], na.rm = T)


# -------------------------------------------------------------------------------------------------------------
#                                 Add Variables related to interaction partner
# -------------------------------------------------------------------------------------------------------------
# create function for later lapply
createIntPartDf <- function(inp) {
  # prepare the dataframe so that we can forloop over it later
  tmp <- data.frame(
    CC = as.character(inp$CC),
    NewCC = as.character(inp$NewCC),
    NewName = as.character(inp$NewName),
    NewCloseness = inp$NewCloseness,
    NewGender = inp$NewGender,
    NewEthnicity = as.character(inp$NewEthnicity),
    NewRelationship = as.character(inp$NewRelationship)
  )

  tmp$CC2 <- recode(tmp$CC, "SOMEONE ELSE" = "NA")
  tmp$CC2 <-
    ifelse(
      tmp$CC == 1 |
        tmp$CC == "SOMEONE ELSE",
      as.character(tmp$NewName),
      as.character(tmp$CC2)
    )
  # maybe add [[:space:]]\b to remove space before word boundary or ^[[:space:]] to remove space in the beginning of a string
  tmp$CC2 <- gsub("^[[:space:]]", "", tmp$CC2)
  tmp$NewName <- gsub("^[[:space:]]", "", tmp$NewName)

  # open the variables that will be filled up in the foor-loop
  tmp$closeness <- rep(NA, nrow(tmp))
  tmp$gender <- rep(NA, nrow(tmp))
  tmp$ethnicity <- rep(NA, nrow(tmp))
  tmp$relationship <- rep(NA, nrow(tmp))

  # Run the for-loop. It finds the variables related to the name of the interaction partner. If there is a repeating interaction
  # partner (i.e. CC2) it takes the value (i.e. NewCloseness) from the first interaction (i.e. NewName)
  for (i in 1:nrow(tmp)) {
    if (is.na(tmp$CC2[i])) {
      next
    } else {
      tmp$closeness[i] <-
        na.omit(tmp$NewCloseness[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # find closeness where CC2 matches NewName (na.omit + [1] to get the number)
      tmp$gender[i] <-
        na.omit(tmp$NewGender[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # (na.omit + [1] to get the number and not the rest of the na.omit list)
      tmp$ethnicity[i] <-
        na.omit(as.character(tmp$NewEthnicity[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1] # PROBLEM IS THAT THERE ARE TOO MANY NA's: Difficult to deal with
      tmp$relationship[i] <-
        na.omit(as.character(tmp$NewRelationship[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1]
    }
  }

  out <- tmp
  out
}

# split df per participants and run function
PP <- split(df, df$PID)
PP <- lapply(PP, createIntPartDf)
rm(createIntPartDf)

# add variables back to df
remergePP <- do.call(rbind.data.frame, PP)
colnames(remergePP) <-
  paste(colnames(remergePP), "_Calc", sep = "")
df <- cbind(df, remergePP)
rm(remergePP, PP)

# -------------------------------------------------------------------------------------------------------------
#                                 Center Relevant Variables
# -------------------------------------------------------------------------------------------------------------

df <- df %>%
  group_by(PID) %>%
  mutate(
    KeyNeedFulfillment.cm = mean(KeyNeedFulfillment, na.rm = TRUE),
    # cluster mean (mean of PP)
    KeyNeedFulfillment.cwc = KeyNeedFulfillment - KeyNeedFulfillment.cm,
    # cluster mean centered (within PP centered)
    closeness.cm = mean(closeness_Calc, na.rm = TRUE),
    closeness.cwc = closeness_Calc - closeness.cm
  ) %>%
  ungroup()

# store
dtS2$full <- df
rm(df)

# Between participants contact frequency
studentContactFreq <- dtS2$full %>%
  group_by(PID) %>%
  summarise(
    n = n(),
    SumContactNL = sum(InteractionDumDutch),
    PercContactNL = SumContactNL / n * 100,
    SumContactNLAll = sum(ContactNum[InteractionDumDutch == 1], na.rm = TRUE),
    AvAttitude = mean(AttitudesDutch, na.rm = TRUE),
    AvQuality = mean(qualityOverall, na.rm = TRUE)
  ) %>%
  mutate(
    WinSumContactNL = DescTools::Winsorize(SumContactNL),
    WinSumContactNLAll = DescTools::Winsorize(SumContactNLAll)
  )

# dataframe where interaction types are recoded
studentInteractionType <- dtS2$full %>%
  mutate(
    NonDutchContact = tidyr::replace_na(NonDutchContact, 2), # make second non-Dutch countable
    NonDutchContact = NonDutchContact*-1+2 # recode (yes = 1 -> 1, no = 2 -> 0)
  ) %>%
  mutate(
    NonDutchNum = ifelse(NonDutchContact == 0, 0, NonDutchNum), # measurement error --- only measured when NonDutchContact==1
    OutgroupInteraction = factor(
      InteractionDumDutch,
      levels = c(0, 1),
      labels = c("No", "Yes")
    ),
    NonOutgroupInteraction = factor(
      rowSums(select(., c(InteractionDumNonDutch, NonDutchContact))), # combine the two non-Dutch Q.,
      levels = c(0, 1),
      labels = c("No", "Yes")
    )
  )

# select a subset of IDs to display in plots
studentPltIDs <-
  studentInteractionType %>%
  group_by(PID) %>%
  summarise(n = n()) %>%
  slice_max(n, n = 20) %>% # chose the 20 with the most number of measurements
  select(PID) %>%
  as.matrix %>%
  as.vector

# select a subset of IDs to display in plots (only outgroup interactions)
studentOutPltIDs <-
  studentInteractionType %>%
  filter(OutgroupInteraction == "Yes") %>%
  group_by(PID) %>%
  summarise(n = n()) %>%
  slice_max(n, n = 20) %>% # chose the 20 with the most number of measurements
  select(PID) %>%
  as.matrix %>%
  as.vector

# Center within and between
# divide into trait and state
studentWithinBetween <-
  MlTraitState(
    data = studentInteractionType,
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AttitudesDutch",
        "qualityOverall",
        "OutgroupInteraction",
        "NonOutgroupInteraction"
      )
  )
studentOutWithinBetween <-
  MlTraitState(
    data = studentInteractionType %>% filter(OutgroupInteraction == "Yes"),
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AttitudesDutch",
        "qualityOverall"
      )
  )

Medical

For the medical professional sample, the data transformation stage had five main aims:

  1. We first create person, survey type, and measurement ID variables.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. We cluster mean-center key variables within participants.
  4. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS3$clean

# Add ID variables
df$PID <- as.numeric(factor(df$ResponseId)) # participant ID

# order time
df$TID <-
  factor(df$date_period, levels = unique(dtS3$raw.daily$date_period))
df$TIDnum <- as.numeric(df$TID) # get numeric TID

# check whether time ordering worked
df <- df %>%
  arrange(PID, TID) # %>%
# View()

# Interaction as Factor
df$interaction.f <-
  factor(df$Interaction,
    levels = c("no interaction", "Dutch", "Non-Dutch")
  )
df$intNL <- ifelse(df$Interaction == "Dutch", 1, 0)
df$intNonNL <- ifelse(df$Interaction == "Non-Dutch", 1, 0)

df <- df %>%
  mutate(
    NonDutchContact = replace_na(NonDutchNum, 0), # make second non-Dutch countable
    NonDutchContact = ifelse(NonDutchContact > 1, 1, 0) # recode (yes = 1 -> 1, no = 2 -> 0)
  ) %>%
  mutate(
    OutgroupInteraction = factor(
      InteractionDumDutch,
      levels = c(0, 1),
      labels = c("No", "Yes")
    ),
    NonOutgroupInteraction = factor(
      rowSums(select(., c(InteractionDumNonDutch, NonDutchContact)), na.rm = TRUE), # combine the two non-Dutch Q.,
      levels = c(0, 1),
      labels = c("No", "Yes")
    )
  )

df$IntergroupContact <- (df$IntergroupContact-2)*-1


# -------------------------------------------------------------------------------------------------------------
#                                       Combine Variables
# -------------------------------------------------------------------------------------------------------------
# Relatedness
pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatednessInteraction <-
  rowMeans(df[c("relatednessSelf", "relatednessOther")], na.rm = TRUE)
df$relatednessInteraction[df$relatednessInteraction == "NaN"] <- NA
# Relatedness Overall (JANNIS NOT SURE THESE ARE CORRECT, CHANGE ROWS?; J: Changed "NaN" in df$RelatednessInteraction to NA() should work now)
df$relatedness <-
  rowMeans(df[, c("relatednessInteraction", "relatednessNoInteraction")],
           na.rm = TRUE) %>%
  ifelse(is.nan(.), NA, .)


df$DaytimeNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)] <-
  df$KeyNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedFullfillment <- NA 
df$InteractionNeedFullfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)] <- 
  df$KeyNeedFulfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedImportance <- NA 
df$InteractionNeedImportance[df$InteractionDum == 1 & !is.na(df$KeyNeedImp)] <- 
  df$KeyNeedImp[df$InteractionDum == 1 & !is.na(df$KeyNeedImp)]


# Pro-Sociality
df$ProSo <-
  rowMeans(df[, c("ProSo1", "ProSo2", "ProSo3", "ProSo4")], na.rm = TRUE)
# Anti-Sociality
df$AntiSo <-
  rowMeans(df[, c("AntiSo1", "AntiSo2", "AntiSo3", "AntiSo4")], na.rm = TRUE)

# Allport's Conditions
df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  pairs.panels.new

df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  psych::describe(., skew=F,ranges=T) %>%
  as.data.frame() %>%
  select(-vars) %>%
  kable(., caption = "Descriptives of Allport's Condition items") %>% 
  kable_styling("hover", full_width = F, latex_options = "hold_position")
Table 1: Descriptives of Allport’s Condition items
n mean sd min max range se
InteractionContextEqualStatus 3099 81.84 23.58 0 100 100 0.4236
KeyNeedShared 3110 84.90 18.74 0 100 100 0.3360
InteractionContextCooperative 3099 85.67 18.35 0 100 100 0.3296
InteractionContextvoluntary 3099 84.14 22.28 0 100 100 0.4002
iaWorkerAllport <- 
  df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  )

sjPlot::tab_itemscale(iaWorkerAllport)
Component 1
Missings Mean SD Skew Item Difficulty Item Discrimination α if deleted
24.54 % 81.84 23.58 -1.43 0.82 0.52 0.64
24.28 % 84.9 18.74 -1.78 0.85 0.42 0.69
24.54 % 85.67 18.35 -1.55 0.86 0.60 0.59
24.54 % 84.14 22.28 -1.7 0.84 0.47 0.67
Mean inter-item-correlation=0.386 · Cronbach’s α=0.709
pca <- parameters::principal_components(iaWorkerAllport)
factor.groups <- parameters::closest_component(pca)

sjPlot::tab_itemscale(iaWorkerAllport, factor.groups)
Component 1
Missings Mean SD Skew Item Difficulty Item Discrimination α if deleted
24.54 % 81.84 23.58 -1.43 0.82 0.52 0.64
24.28 % 84.9 18.74 -1.78 0.85 0.42 0.69
24.54 % 85.67 18.35 -1.55 0.86 0.60 0.59
24.54 % 84.14 22.28 -1.7 0.84 0.47 0.67
Mean inter-item-correlation=0.386 · Cronbach’s α=0.709
ltm::cronbach.alpha(na.omit(iaWorkerAllport), CI = TRUE)
## 
## Cronbach's alpha for the 'na.omit(iaWorkerAllport)' data-set
## 
## Items: 4
## Sample units: 3099
## alpha: 0.709
## 
## Bootstrap 95% CI based on 1000 samples
##  2.5% 97.5% 
## 0.686 0.730
data <- 
  df %>%
  select(
    PID,
    TIDnum,
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  drop_na %>%
  melt(
    ., 
    id.vars = c("PID", "TIDnum")
  )


horst::nestedAlpha(item.level.1 = "value",
                   level.2      = "TIDnum",
                   level.3      = "PID",
                   data         = data)
##  alpha 
## 0.7829
rm(data)

iaWorkerAllportScale <- 
  iaWorkerAllport %>%
  Scale::Scale() %>%
  Scale::ItemAnalysis()

df$AllportsCondition <-
  scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(
      InteractionContextEqualStatus,
      KeyNeedShared,
      InteractionContextCooperative,
      InteractionContextvoluntary
    ),
    min = 0,
    max = 100
  )$scores

as.data.frame(psych::describe(df$AllportsCondition, skew=T)) %>%
  mutate(vars = "Allport's Conditions Index") %>%
  kable(., caption = "Allport's Conditions: Scale Descriptives", row.names = FALSE) %>% 
  kable_styling("hover", full_width = F, latex_options = "hold_position")
Table 1: Allport’s Conditions: Scale Descriptives
vars n mean sd median trimmed mad min max range skew kurtosis se
Allport’s Conditions Index 4107 86.49 13.88 93.75 88.6 9.266 0 100 100 -1.454 2.406 0.2165
ggplot(df, aes(x = AllportsCondition)) +
  geom_histogram() +
  theme_Publication()

# -------------------------------------------------------------------------------------------------------------
#                                 Add Variables related to interaction partner
# -------------------------------------------------------------------------------------------------------------
# create function for later lapply
createIntPartDf <- function(inp) {
  # prepare the dataframe so that we can forloop over it later
  tmp <- data.frame(
    CC = as.character(inp$CC),
    NewCC = as.character(inp$NewCC),
    NewName = as.character(inp$NewName),
    NewCloseness = inp$NewCloseness,
    NewGender = inp$NewGender,
    NewEthnicity = as.character(inp$NewEthnicity),
    NewRelationship = as.character(inp$NewRelationship)
  )

  tmp$CC2 <- recode(tmp$CC, "SOMEONE ELSE" = "NA")
  tmp$CC2 <-
    ifelse(
      tmp$CC == 1 |
        tmp$CC == "SOMEONE ELSE",
      as.character(tmp$NewName),
      as.character(tmp$CC2)
    )
  # maybe add [[:space:]]\b to remove space before word boundary or ^[[:space:]] to remove space in the beginning of a string
  tmp$CC2 <- gsub("^[[:space:]]", "", tmp$CC2)
  tmp$NewName <- gsub("^[[:space:]]", "", tmp$NewName)

  # open the variables that will be filled up in the foor-loop
  tmp$closeness <- rep(NA, nrow(tmp))
  tmp$gender <- rep(NA, nrow(tmp))
  tmp$ethnicity <- rep(NA, nrow(tmp))
  tmp$relationship <- rep(NA, nrow(tmp))

  # Run the for-loop. It finds the variables related to the name of the interaction partner. If there is a repeating interaction
  # partner (i.e. CC2) it takes the value (i.e. NewCloseness) from the first interaction (i.e. NewName)
  for (i in 1:nrow(tmp)) {
    if (is.na(tmp$CC2[i])) {
      next
    } else {
      tmp$closeness[i] <-
        na.omit(tmp$NewCloseness[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # find closeness where CC2 matches NewName (na.omit + [1] to get the number)
      tmp$gender[i] <-
        na.omit(tmp$NewGender[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # (na.omit + [1] to get the number and not the rest of the na.omit list)
      tmp$ethnicity[i] <-
        na.omit(as.character(tmp$NewEthnicity[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1] # PROBLEM IS THAT THERE ARE TOO MANY NA's: Difficult to deal with
      tmp$relationship[i] <-
        na.omit(as.character(tmp$NewRelationship[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1]
    }
  }

  out <- tmp
  out
}

# split df per participants and run function
PP <- split(df, df$PID)
PP <- lapply(PP, createIntPartDf)
rm(createIntPartDf)

# add variables back to df
remergePP <- do.call(rbind.data.frame, PP)
colnames(remergePP) <-
  paste(colnames(remergePP), "_Calc", sep = "")
df <- cbind(df, remergePP)
rm(remergePP, PP)

# -------------------------------------------------------------------------------------------------------------
#                                 Center Relevant Variables
# -------------------------------------------------------------------------------------------------------------
# divide into trait and state
medicalOutWithinBetween <-
  MlTraitState(
    data = df %>% filter(OutgroupInteraction == "Yes"),
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AllportsCondition",
        "AttitudesDutch",
        "qualityOverall"
      )
  )

medicalWithinBetween <-
  MlTraitState(
    data = df,
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AllportsCondition",
        "AttitudesDutch",
        "qualityOverall",
        "OutgroupInteraction",
        "NonOutgroupInteraction"
      )
  )

df <- # keep only for compatibility of old framgents
  MlTraitState(
    data = df,
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AllportsCondition",
        "AttitudesDutch",
        "qualityOverall"
      )
  )

# store
dtS3$full <- df
rm(df)


# Between participants contact frequency
medicalContactFreq <- 
  dtS3$full %>%
  group_by(PID) %>%
  summarise(
    n = n(),
    SumContactNL = sum(InteractionDumDutch, na.rm = TRUE),
    PercContactNL = SumContactNL / n * 100,
    SumContactNLAll = sum(ContactNum[InteractionDumDutch == 1], na.rm = TRUE),
    AvAttitude = mean(AttitudesDutch, na.rm = TRUE),
    AvQuality = mean(qualityOverall, na.rm = TRUE)
  ) %>%
  mutate(
    WinSumContactNL = DescTools::Winsorize(SumContactNL),
    WinSumContactNLAll = DescTools::Winsorize(SumContactNLAll)
  )

# select a subset of IDs to display in plots
medicalPltIDs <-
  dtS3$full %>%
  group_by(PID) %>%
  summarise(n = n()) %>%
  slice_max(n, n = 20) %>% # chose the 20 with the most number of measurements
  select(PID) %>%
  as.matrix %>%
  as.vector

# select a subset of IDs to display in plots (only outgroup interactions)
medicalOutPltIDs <-
  dtS3$full %>%
  filter(OutgroupInteraction == "Yes") %>%
  group_by(PID) %>%
  summarise(n = n()) %>%
  slice_max(n, n = 20) %>% # chose the 20 with the most number of measurements
  select(PID) %>%
  as.matrix %>%
  as.vector

Data Availability and Sample Selection

As one of our main analyses is a three-mode principal component analysis (3MPCA) we begin by assessing the amount of missing data in each of the ESM studies. To assess the missingness in detail, we prepare a data availability table of whether data is available or missing for each possible measurement point (data + morning/afternoon) for all individual participants. We then export the data availability tables as comma separated value files (.csv) to be assessed in detail using a spreadsheet program (such as MS Excel).

Study 1

dtS1Availability <- dtS1$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS1Availability <- reshape::cast(dtS1Availability, PID ~ TIDnum) %>%
  select(-PID) %>%
  mutate_all(function(x) ifelse(x>1,1,x))
# sum(colMeans(dtS1Availability)*100 >= 66)
# sum(rowMeans(dtS1Availability)*100 >= 66)
# sum(colMeans(dtS1Availability[-5,])*100 >= 66)
# sum(rowMeans(dtS1Availability[,-8])*100 >= 66)

rownames(dtS1Availability) <- paste("PP", 1:nrow(dtS1Availability), sep = "_")
colnames(dtS1Availability) <- paste("t", 1:ncol(dtS1Availability), sep = "_")
dtS1Availability[1:ncol(dtS1Availability)] <- lapply(dtS1Availability[1:ncol(dtS1Availability)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS1Availability,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 1: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 2: Study 1: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63
PP_1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
PP_2 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_3 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0
PP_4 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0
PP_5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_22 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_23 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
write.csv(dtS1Availability, "data/S1_Workers/processed/workerAvailability.csv")

Study 2

dtS2Availability <- dtS2$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS2Availability <- reshape::cast(dtS2Availability, PID ~ TIDnum) %>%
  select(-PID)

rownames(dtS2Availability) <- paste("PP", 1:nrow(dtS2Availability), sep = "_")
colnames(dtS2Availability) <- paste("t", 1:ncol(dtS2Availability), sep = "_")

write.csv(dtS2Availability, "data/S2_Students/processed/studentAvailability.csv")

dtS2Availability[1:ncol(dtS2Availability)] <- lapply(dtS2Availability[1:ncol(dtS2Availability)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS2Availability,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 2: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 3: Study 2: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 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1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
PP_109 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0
PP_110 0 0 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_111 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_112 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0
PP_113 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1 1 1 0 1 0 0

Study 3

dtS3Availability <- dtS3$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS3Availability <- reshape::cast(dtS3Availability, PID ~ TIDnum) %>%
  select(-PID)

rownames(dtS3Availability) <- paste("PP", 1:nrow(dtS3Availability), sep = "_")
colnames(dtS3Availability) <- paste("t", 1:ncol(dtS3Availability), sep = "_")

write.csv(dtS3Availability, "data/S3_Medical/processed/medicalAvailability.csv")

dtS3Availability[1:ncol(dtS3Availability)] <- lapply(dtS3Availability[1:ncol(dtS3Availability)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS3Availability,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 2: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 4: Study 2: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63 t_64 t_65 t_66 t_67 t_68 t_69 t_70 t_71 t_72 t_73 t_74 t_75 t_76 t_77 t_78 t_79 t_80 t_81 t_82 t_83 t_84 t_85 t_86 t_87 t_88 t_89 t_90 t_91 t_92 t_93 t_94 t_95 t_96 t_97 t_98 t_99 t_100 t_101 t_102 t_103 t_104 t_105 t_106 t_107 t_108 t_109 t_110 t_111 t_112 t_113 t_114 t_115 t_116 t_117 t_118 t_119 t_120 t_121 t_122 t_123 t_124 t_125 t_126 t_127 t_128 t_129 t_130 t_131 t_132 t_133 t_134 t_135 t_136 t_137 t_138 t_139 t_140 t_141 t_142 t_143 t_144 t_145 t_146 t_147 t_148 t_149 t_150 t_151 t_152 t_153 t_154 t_155
PP_1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0
PP_70 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_71 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 2 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Time Scales and Timepoint Aggregation

varNamesPre <- varNames %>%
  filter(
    surveyS1 == "pre",
    surveyS2 == "pre",
    str_detect(surveyS3, "^pre")
  ) %>%
  select(varNam)
varNamesPreFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1$full), names(dtS3$full), names(dtS3$full)
  ))) %>%
  filter(str_detect(varNam, ".pre$"))

varNamesDaily <- varNames %>%
  filter(
    surveyS1 == "daily",
    surveyS2 == "daily",
    surveyS3 == "daily"
  ) %>%
  select(varNam)
varNamesDailyFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1$full), names(dtS3$full), names(dtS3$full)
  ))) %>%
  filter(!str_detect(varNam, ".pre$|.post$"))

varNamesPost <- varNames %>%
  filter(
    surveyS1 == "post",
    surveyS2 == "post",
    surveyS3 == "post"
  ) %>%
  select(varNam)
varNamesPostFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1$full), names(dtS3$full), names(dtS3$full)
  ))) %>%
  filter(str_detect(varNam, ".post$"))
# Main Analysis: 3MPCA (common variables across studies)
dropVarPcaMain <- c(
  # Meta Data
  "last_outside_referrer",
  "created",
  "ended",
  "ip_address",
  "date",
  "ResponseId",
  "server_language",
  "Meta_Browser",
  # Interaction Dummies (non-continuous)
  "IntergroupContact",
  "IngroupContact",
  "InteractionDum",
  # Interaction Counts (non-continuous)
  "ContactNum",
  "NonDutchNum",
  # Interaction Descriptives (non-continuous)
  "duration",
  "dyadGroup",
  "groupSize",
  # Keyneed Freetexts (non-continuous)
  "KeyNeed",
  "DaytimeNeed",
  # Relatedness individual items
  "relatednessSelf",
  "relatednessOther",
  "relatednessNoInteraction"
)


varNam3mpcaMain <- varNamesDailyFull %>%
  filter(!varNam %in% dropVarPcaMain) %>%
  pull

dtMain3mpca <- rbind(
  dtS1$full %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S1"),
  dtS3$full %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S2"),
  dtS3$full %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S3")
  ) %>%
  group_by(study, PID) %>%
  mutate(ID = cur_group_id()) %>%
  ungroup %>%
  mutate(
    date = as.Date(gsub(" .*", "", TID)),
    week = strftime(date, format = "%Y-W%V")
    ) %>%
  select(
    ID,
    PID,
    TID,
    date,
    week,
    TIDnum,
    study,
    everything()
  ) %>%
  arrange(ID, TIDnum)

dtMain3mpcaDaily <- dtMain3mpca %>%
  group_by(ID, date, study) %>%
  summarise_if(is.numeric, mean, na.rm = TRUE) %>%
  ungroup %>%
  group_by(study) %>%
  mutate(TIDnum = as.numeric(factor(date))) %>%
  ungroup %>%
  select(ID, date, TIDnum, everything()) %>%
  mutate_all(~ifelse(is.nan(.), NA, .))

dtMain3mpcaWeekly <- dtMain3mpca %>%
  group_by(ID, week, study) %>%
  summarise_if(is.numeric, mean, na.rm = TRUE) %>%
  ungroup %>%
  group_by(study) %>%
  mutate(TIDnum = as.numeric(factor(week))) %>%
  ungroup %>%
  select(ID, week, TIDnum, everything()) %>%
  mutate_all(~ifelse(is.nan(.), NA, .))

dtMain3mpcaWeekly
## # A tibble: 1,132 × 20
##       ID week     TIDnum study   PID KeyNeedFulfillment KeyNeedDueToPartner InteractionContextAccidental InteractionContextvoluntary InteractionContextCooperative InteractionContextRepresentativeNL qualityOverall qualityMeaning DaytimeNeedFulfillment AttitudesDutch AttitudesPartner   exWB relatedness autonomy competence
##    <int> <chr>     <dbl> <chr> <dbl>              <dbl>               <dbl>                        <dbl>                       <dbl>                         <dbl>                              <dbl>          <dbl>          <dbl>                  <dbl>          <dbl>            <dbl>  <dbl>       <dbl>    <dbl>      <dbl>
##  1     1 2018-W19      1 S1        1              30.6                19.4                       -20.4                        15.1                          -0.845                               1.90          16.5           33.5                 -49.9             75.2             89    2.5         16.0      4.08     -0.565
##  2     1 2018-W20      2 S1        1              10.5                11.1                        -5.34                        9.72                          6.49                                5.34           8.67          15.7                  -0.958           78.3             84.4  0.643        9.73     4.52     -9.28 
##  3     1 2018-W21      3 S1        1               4.17               22.1                        -2.34                        0.622                        12.0                                 4.73           2.4            8.4                  -3.21            76.1             85.2 -5.64         9.52    -1.54    -16.2  
##  4     1 2018-W22      4 S1        1              16.6                19.0                         2.49                        5.21                         19.6                                13.8            9.22          13.9                  10.6             77.1             86.1 -1.36         3.99     4.87    -14.2  
##  5     1 2018-W23      5 S1        1              12.8                12.6                        -4.08                        8.08                          9.75                                4.99          14.4           12.8                   7.43            76.8             86.4 -2           12.7      1.60     -1.21 
##  6     1 2018-W24      6 S1        1              NA                  NA                          NA                          NA                            NA                                  NA             NA             NA                    12.0             75               NA   -2.5          1.97     7.12      4.37 
##  7     2 2018-W19      1 S1        2              NA                  NA                          NA                          NA                            NA                                  NA             NA             NA                    50               74.5             NA   29           38.7     16.8     -14.7  
##  8     2 2018-W20      2 S1        2              31.2                17.2                        -9.58                       38.4                          13.9                                 5.96          33              6.33                 32.5             78.9             97   21.4         15.0     13.3      11.6  
##  9     2 2018-W21      3 S1        2              34.7                32.9                       -50                          40.9                          31.8                                11.5           31              6.5                  32.8             76.6             95.2  6.08        10.1     19.1       1.63 
## 10     2 2018-W22      4 S1        2              50                  -1.93                        0.540                      31.7                          31.9                                -2.36          44              6.33                 39.7             77.4             97   15.4          5.95    27.2      12.9  
## # … with 1,122 more rows
stats::reshape(dtMain3mpca, idvar = "ID", timevar = "TIDnum", direction = "wide")
## # A tibble: 165 × 21
##       ID `PID.c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, …` `TID.c(1, 2, 3…` `date.c(1, 2, …` `week.c(1, 2, …` `study.c(1, 2,…` `KeyNeedFulfil…` `KeyNeedDueToP…` `InteractionCo…` `InteractionCo…` `InteractionCo…` `InteractionCo…` `qualityOveral…` `qualityMeanin…` `DaytimeNeedFu…` `AttitudesDutc…` `AttitudesPart…` `exWB.c(1, 2, …` `relatedness.c…` `autonomy.c(1,…` `competence.c(…`
##    <int>                                                                <dbl> <chr>            <date>           <chr>            <chr>                       <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>
##  1     1                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
##  2     2                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
##  3     3                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
##  4     4                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
##  5     5                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
##  6     6                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
##  7     7                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
##  8     8                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
##  9     9                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
## 10    10                                                                   NA <NA>             NA               <NA>             <NA>                           NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA               NA
## # … with 155 more rows




Plots per Item

The three-mode PCA ultimately aims to explain the most variance with the fewest components (by maximizing the variance of data mapped in a lower dimensional space — often by maximally separating groups of cases with similar variable patterns). Importantly, this procedure depends on variances and covariances to be present within the data. As one of our three modes is time and variance over time is not always given (e.g., because a variable is stable over the measured time span, such as personality over a month), it becomes important to assess whether a dimension reduction is possible for the variables measured during the measured time period. We, thus, start by visually inspecting the average changes and variance developments of all potentially relevant variables. We hope so see changes within the means and standard deviations over the measurement period.

Study 1 (Worker)

The first study, utilized not only the smallest sample but also a slightly different set of measured variables compared to the later two studies. Several variables are consistent across all three studies (e.g., types of social interactions, interaction needs, self-determiantion theory needs, outgroup attitudes, and experienced well-being). Study 1 additionally included several emotion and mood measurements but fewer cognitive and behavioral measures than studies two and three.

We first select all potentially relevant variables and their labels, and then group the variables in small groups of one to three variables for plotting.

#median(rbind(rbind(dtS1$raw.pre$timeNL_1, dtS2$raw.pre$timeNL), dtS3$raw.pre$timeNL), na.rm=TRUE)
varListWorker <- 
  c(
    "IntergroupContact",
    "InteractionDum",
    "DaytimeNeedFullfillment",
    "InteractionNeedFullfillment",
    "autonomy",
    "competence",
    "relatedness",
    "AttitudesDutch",
    "AttitudesPartner",
    "ExWB",
    "alertness",
    "calmness",
    "valence",
    "MDMQ.v1_1",
    "MDMQ.v1_2",
    "MDMQ.v1_3",
    "MDMQ.v1_4",
    "MDMQ.v1_5",
    "MDMQ.v1_6",
    "MDMQ.v1_7",
    "MDMQ.v1_8",
    "MDMQ.v1_9",
    "MDMQ.v1_10",
    "MDMQ.v1_11",
    "MDMQ.v1_12",
    "MDMQ.v1_13",
    "MDMQ.v2_1",
    "MDMQ.v2_2",
    "MDMQ.v2_3",
    "MDMQ.v2_4",
    "MDMQ.v2_5",
    "MDMQ.v2_6",
    "MDMQ.v2_7",
    "MDMQ.v2_8",
    "MDMQ.v2_9",
    "MDMQ.v2_10",
    "MDMQ.v2_11",
    "MDMQ.v2_12",
    "MDMQ.v2_13"
  )

varNameListWorker <- 
  c(
    "IntergroupContact" = "Dutch Interaction",
    "InteractionDum" = "Any Interaction",
    "DaytimeNeedFullfillment" = "Daytime Core Motive Fulfillment",
    "InteractionNeedFullfillment" = "Interaction Core Motive Fulfillment",
    "autonomy" = "Autonomy",
    "competence" = "Competence",
    "relatedness" = "Relatedness",
    "AttitudesDutch" = "Outgroup Attitude",
    "AttitudesPartner" = "Attitude Interaction Partner",
    "ExWB" = "Sadness Happiness",
    "alertness" = "Alertness",
    "calmness" = "Calmness",
    "valence" = "Emotional Valence",
    "MDMQ.v1_1" = "content",
    "MDMQ.v1_2" = "rested",
    "MDMQ.v1_3" = "restless",
    "MDMQ.v1_4" = "bad",
    "MDMQ.v1_5" = "worn-out",
    "MDMQ.v1_6" = "composed",
    "MDMQ.v1_7" = "tired",
    "MDMQ.v1_8" = "great",
    "MDMQ.v1_9" = "uneasy",
    "MDMQ.v1_10" = "energetic",
    "MDMQ.v1_11" = "uncomfortable",
    "MDMQ.v1_12" = "relaxed",
    "MDMQ.v1_13" = "alive and vital",
    "MDMQ.v2_1" = "sleepy",
    "MDMQ.v2_2" = "good",
    "MDMQ.v2_3" = "at ease",
    "MDMQ.v2_4" = "unhappy",
    "MDMQ.v2_5" = "alert",
    "MDMQ.v2_6" = "discontent",
    "MDMQ.v2_7" = "tense",
    "MDMQ.v2_8" = "fresh",
    "MDMQ.v2_9" = "happy",
    "MDMQ.v2_10" = "nervous",
    "MDMQ.v2_11" = "exhausted",
    "MDMQ.v2_12" = "calm",
    "MDMQ.v2_13" = "alive and vital"
  )

dtS1$viz <- list()

dtS1$vizall <- dtS1$full %>%
  select(
    PID,
    TID,
    TIDnum,
    all_of(varListWorker)
  )

dtS1$viz$Interaction <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    IntergroupContact,
    InteractionDum
  )

dtS1$viz$KeyNeed <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    DaytimeNeedFullfillment,
    InteractionNeedFullfillment
  )

dtS1$viz$SDT <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    autonomy,
    relatedness, 
    competence
  )

dtS1$viz$Attitudes <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    starts_with("Attitudes")
  )

dtS1$viz$WB <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ExWB
  )

dtS1$viz$MoodOverall <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    alertness,
    calmness,
    valence
  )

dtS1$viz$MoodV01Pt01 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_1,
    MDMQ.v1_2
  )

dtS1$viz$MoodV01Pt02 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_3,
    MDMQ.v1_4
  )

dtS1$viz$MoodV01Pt03 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_5,
    MDMQ.v1_6
  )

dtS1$viz$MoodV01Pt04 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_7,
    MDMQ.v1_8
  )

dtS1$viz$MoodV01Pt05 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_9,
    MDMQ.v1_10
  )

dtS1$viz$MoodV01Pt06 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_11,
    MDMQ.v1_12,
    MDMQ.v1_13
  )

dtS1$viz$MoodV02Pt01 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_1,
    MDMQ.v2_2
  )

dtS1$viz$MoodV02Pt02 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_3,
    MDMQ.v2_4
  )

dtS1$viz$MoodV02Pt03 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_5,
    MDMQ.v2_6
  )

dtS1$viz$MoodV02Pt04 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_7,
    MDMQ.v2_8
  )

dtS1$viz$MoodV02Pt05 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_9,
    MDMQ.v2_10
  )

dtS1$viz$MoodV02Pt06 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_11,
    MDMQ.v2_12,
    MDMQ.v2_13
  )

Mean Plots

We begin by plotting the item means of all variables. We always only display one to three variables jointly to improve visual inspection. We plot the means of the individual variables for each measurement occasion, summarizing the responses of all participants at any given time point. We additionally plot the data availability of each variable as a marginal plot above the main plot. The displayed time axis is the measurement index rather than the actual date to ensure comparability of the changes between each measurement. Plots with the raw date-time axis are saved and can be displayed if necessary.

SD Plots

To illustrate the developments of variance around the previously displayed means, we then plot the item standard deviations of all variables. We, thus, plot the average variation from the mean for each individual variable, again summarizing the responses of all participants at any given time point. We retain the same variable grouping, the data availability line plot, and the measurement index as the x axis.

Study 2 (Student)

During the second study we collected the largest sample and additionally collected a range of motivations as well as pro-social and anti-social behaviors.

We, again, select all potentially relevant variables and their labels, and then group the variables in small groups of one to three variables for plotting.

varListStudent <- 
  c(
    "IntergroupContact",
    "InteractionDum",
    # "KeyNeedFullfillment",
    # "KeyNeedImp",
    "DaytimeNeedFullfillment",
    #"DaytimeNeedImportance",
    "InteractionNeedFullfillment",
    #"InteractionNeedImportance",
    "AntiSo1",
    "AntiSo2",
    "AntiSo3",
    "AntiSo4",
    "AntiSo5",
    "AntiSo6",
    "AntiSo7",
    "ProSo1",
    "ProSo2",
    "ProSo3",
    "ProSo4",
    "StudentGoal01",
    "StudentGoal02",
    "StudentGoal03",
    "StudentGoal04",
    "StudentGoal05",
    "StudentGoal06",
    "StudentGoal07",
    "StudentGoal08",
    "StudentGoal09",
    "StudentGoal10",
    "autonomy",
    "competence",
    # Break relatedness up into interaction vs. no interaction(?)
    # vars are already calculated
    "relatedness",
    "AttitudesDutch",
    "AttitudesPartner",
    "ExWB",
    #"angry",
    #"afraid",
    #"energy",
    #"lonelyAlways",
    "Event"
  )

varNameListStudent <- 
  c(
    "IntergroupContact" = "Dutch Interaction",
    "InteractionDum" = "Any Interaction",
    # "KeyNeedFulfillment" = "Key Need Fulfillment",
    # "KeyNeedImp" = "Key Need Importance",
    "DaytimeNeedFullfillment" = "Daytime Core Motive Fulfillment",
    #"DaytimeNeedImportance" = "Daytime Core Motive Importance",
    "InteractionNeedFullfillment" = "Interaction Core Motive Fulfillment",
    #"InteractionNeedImportance" = "Interaction Core Motive Importance",
    "AntiSo1" = "Put someone down",
    "AntiSo2" = "Show little attention in someones opinion",
    "AntiSo3" = "Demeaning remarks",
    "AntiSo4" = "Inpropperly addressing someone",
    "AntiSo5" = "Ignored or excluded someone",
    "AntiSo6" = "Doubt someones judgement",
    "AntiSo7" = "Unwanted attempts of personal matters",
    "ProSo1" = "Listen to someones problems",
    "ProSo2" = "Cheer someone up",
    "ProSo3" = "Help someone get things done",
    "ProSo4" = "Help someone with responsibilities",
    "StudentGoal01" = "Social support and connectedness",
    "StudentGoal02" = "Romantic or sexual relationship",
    "StudentGoal03" = "Academic",
    "StudentGoal04" = "Career",
    "StudentGoal05" = "Financial",
    "StudentGoal06" = "Health and fitness",
    "StudentGoal07" = "Leasure and fun",
    "StudentGoal08" = "Personal improvement and growth",
    "StudentGoal09" = "Service and help",
    "StudentGoal10" = "Spiritual or religious",
    "autonomy" = "Autonomy",
    "competence" = "Competence",
    # Break relatedness up into interaction vs. no interaction(?)
    # vars are already calculated
    "relatedness" = "Relatedness",
    "AttitudesDutch" = "Outgroup Attitude",
    "AttitudesPartner" = "Attitude Interaction Partner",
    "ExWB" = "Sadness Happiness",
    #"angry" = "Anger",
    #"afraid" = "Anxiety",
    #"energy" = "Energy",
    #"lonelyAlways" = "Loneliness",
    "Event" = "Positive or negative event present"
  )

dtS2$viz <- list()

dtS2$vizall <- dtS2$full %>%
  select(
    PID,
    TID,
    TIDnum,
    all_of(varListStudent)
  )

dtS2$viz$Interaction <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    IntergroupContact,
    InteractionDum
  )

dtS2$viz$KeyNeed <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    DaytimeNeedFullfillment,
    InteractionNeedFullfillment
  )

dtS2$viz$AntiSocialBehaviorPt1 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo1,
    AntiSo2,
    AntiSo3
  )

dtS2$viz$AntiSocialBehaviorPt2 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo4,
    AntiSo5
  )

dtS2$viz$AntiSocialBehaviorPt3 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo6,
    AntiSo7
  )

dtS2$viz$ProSocialBehaviorPt1 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ProSo1,
    ProSo2
  )

dtS2$viz$ProSocialBehaviorPt2 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ProSo3,
    ProSo4
  )

dtS2$viz$GoalsPt1 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal01,
    StudentGoal02
  )

dtS2$viz$GoalsPt2 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal03,
    StudentGoal04
  )

dtS2$viz$GoalsPt3 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal05,
    StudentGoal06
  )

dtS2$viz$GoalsPt4 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal07,
    StudentGoal08
  )

dtS2$viz$GoalsPt5 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal09,
    StudentGoal10
  )

dtS2$viz$SDT <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    autonomy,
    relatedness, 
    competence
  )

dtS2$viz$Attitudes <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    starts_with("Attitudes")
  )

dtS2$viz$WB <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ExWB
  )

dtS2$viz$Event <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    Event
  )

Mean Plots

We again begin by plotting the item means of all variables. The plotting method is identical to that of Study 1.

SD Plots

We then also plot the average variation around the mean for each time point and variable. The plotting method is identical to that of Study 1.

Study 3 (Medical)

The third study uses a similar set up as Study 2 but targets a more vulnerable sample (of young medical professionals). While most key variables are identical to Study 2, in this last study we additionally collected several cognitive evaluations (e.g., importance ratings) and emotional status measures (e.g., anger, nervousness, energy, and loneliness).

We, again, select all potentially relevant variables and their labels, and then group the variables in small groups of one to three variables for plotting.

varListMedical <- 
  c(
    "IntergroupContact",
    "InteractionDum",
    # "KeyNeedFulfillment",
    # "KeyNeedImp",
    "DaytimeNeedFullfillment",
    "DaytimeNeedImportance",
    "InteractionNeedFullfillment",
    "InteractionNeedImportance",
    "AntiSo1",
    "AntiSo2",
    "AntiSo3",
    "AntiSo4",
    "AntiSo5",
    "AntiSo6",
    "AntiSo7",
    "ProSo1",
    "ProSo2",
    "ProSo3",
    "ProSo4",
    "StudentGoal01",
    "StudentGoal02",
    "StudentGoal03",
    "StudentGoal04",
    "StudentGoal05",
    "StudentGoal06",
    "StudentGoal07",
    "StudentGoal08",
    "StudentGoal09",
    "StudentGoal10",
    "Autonomy",
    "Competence",
    # Break relatedness up into interaction vs. no interaction(?)
    # vars are already calculated
    "relatedness",
    "AttitudesDutch",
    "AttitudesPartner",
    "exWB",
    "angry",
    "afraid",
    "energy",
    "lonelyAlways",
    "Event"
  )

varNameListMedical <- 
  c(
    "IntergroupContact" = "Dutch Interaction",
    "InteractionDum" = "Any Interaction",
    # "KeyNeedFulfillment" = "Key Need Fulfillment",
    # "KeyNeedImp" = "Key Need Importance",
    "DaytimeNeedFullfillment" = "Daytime Core Motive Fulfillment",
    "DaytimeNeedImportance" = "Daytime Core Motive Importance",
    "InteractionNeedFullfillment" = "Interaction Core Motive Fulfillment",
    "InteractionNeedImportance" = "Interaction Core Motive Importance",
    "AntiSo1" = "Put someone down",
    "AntiSo2" = "Show little attention in someones opinion",
    "AntiSo3" = "Demeaning remarks",
    "AntiSo4" = "Inpropperly addressing someone",
    "AntiSo5" = "Ignored or excluded someone",
    "AntiSo6" = "Doubt someones judgement",
    "AntiSo7" = "Unwanted attempts of personal matters",
    "ProSo1" = "Listen to someones problems",
    "ProSo2" = "Cheer someone up",
    "ProSo3" = "Help someone get things done",
    "ProSo4" = "Help someone with responsibilities",
    "StudentGoal01" = "Social support and connectedness",
    "StudentGoal02" = "Romantic or sexual relationship",
    "StudentGoal03" = "Academic",
    "StudentGoal04" = "Career",
    "StudentGoal05" = "Financial",
    "StudentGoal06" = "Health and fitness",
    "StudentGoal07" = "Leasure and fun",
    "StudentGoal08" = "Personal improvement and growth",
    "StudentGoal09" = "Service and help",
    "StudentGoal10" = "Spiritual or religious",
    "Autonomy" = "Autonomy",
    "Competence" = "Competence",
    # Break relatedness up into interaction vs. no interaction(?)
    # vars are already calculated
    "relatedness" = "Relatedness",
    "AttitudesDutch" = "Outgroup Attitude",
    "AttitudesPartner" = "Attitude Interaction Partner",
    "exWB" = "Sadness Happiness",
    "angry" = "Anger",
    "afraid" = "Anxiety",
    "energy" = "Energy",
    "lonelyAlways" = "Loneliness",
    "Event" = "Positive or negative event present"
  )

dtS3$viz <- list()

dtS3$vizall <- dtS3$full %>%
  select(
    PID,
    TID,
    TIDnum,
    all_of(varListMedical)
  )

dtS3$viz$Interaction <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    IntergroupContact,
    InteractionDum
  )

dtS3$viz$KeyNeedFulfillment <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    DaytimeNeedFullfillment,
    InteractionNeedFullfillment
  )

dtS3$viz$KeyNeedImportance <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    DaytimeNeedImportance,
    InteractionNeedImportance
  )

dtS3$viz$AntiSocialBehaviorPt1 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo1,
    AntiSo2,
    AntiSo3
  )

dtS3$viz$AntiSocialBehaviorPt2 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo4,
    AntiSo5
  )

dtS3$viz$AntiSocialBehaviorPt3 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo6,
    AntiSo7
  )

dtS3$viz$ProSocialBehaviorPt1 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ProSo1,
    ProSo2
  )

dtS3$viz$ProSocialBehaviorPt2 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ProSo3,
    ProSo4
  )

dtS3$viz$GoalsPt1 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal01,
    StudentGoal02
  )

dtS3$viz$GoalsPt2 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal03,
    StudentGoal04
  )

dtS3$viz$GoalsPt3 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal05,
    StudentGoal06
  )

dtS3$viz$GoalsPt4 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal07,
    StudentGoal08
  )

dtS3$viz$GoalsPt5 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal09,
    StudentGoal10
  )

dtS3$viz$SDT <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    autonomy,
    relatedness, 
    competence
  )

dtS3$viz$Attitudes <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    starts_with("Attitudes")
  )

dtS3$viz$WB <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    exWB
  )

dtS3$viz$Emotion <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    angry,
    afraid,
    energy,
    lonelyAlways
  )

dtS3$viz$Event <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    Event
  )

Mean Plots

As with the previous studies, we begin by plotting the item means of all variables. The plotting method is identical to that of Studies 1 and 2.

SD Plots

Lastly, also again plot the item standard deviations of all variables at each time point. The plotting procedures are again identical to Studies 1 and 2.




Software Information

The full ResponseId information with all relevant system information and all loaded and installed packages is available in the collapsible section below.

System Info
Table 5: R environment session info for reproducibility of results
Setting Value
version R version 4.1.1 (2021-08-10)
os macOS Big Sur 10.16
system x86_64, darwin17.0
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Amsterdam
date 2022-06-17

Package Info
Table 6: Package info for reproducibility of results
Package Loaded version Date Source
bookdown 0.24 2021-09-02 CRAN (R 4.1.0)
brms 2.16.1 2021-08-23 CRAN (R 4.1.0)
data.table 1.14.0 2021-02-21 CRAN (R 4.1.0)
devtools 2.4.2 2021-06-07 CRAN (R 4.1.0)
dplyr 1.0.9 2022-04-28 CRAN (R 4.1.2)
dygraphs 1.1.1.6 2018-07-11 CRAN (R 4.1.0)
ellipse 0.4.2 2020-05-27 CRAN (R 4.1.0)
Formula 1.2-4 2020-10-16 CRAN (R 4.1.0)
ggpattern 0.2.0 2021-10-11 Github ()
ggplot2 3.3.6 2022-05-03 CRAN (R 4.1.1)
ggthemes 4.2.4 2021-01-20 CRAN (R 4.1.0)
gridExtra 2.3 2017-09-09 CRAN (R 4.1.0)
gtsummary 1.4.2 2021-07-13 CRAN (R 4.1.0)
haven 2.4.3 2021-08-04 CRAN (R 4.1.0)
Hmisc 4.5-0 2021-02-28 CRAN (R 4.1.0)
jtools 2.1.4 2021-09-03 CRAN (R 4.1.0)
kableExtra 1.3.4 2021-02-20 CRAN (R 4.1.0)
knitr 1.39 2022-04-26 CRAN (R 4.1.2)
lattice 0.20-44 2021-05-02 CRAN (R 4.1.1)
lme4 1.1-29 2022-04-07 CRAN (R 4.1.2)
lubridate 1.7.10 2021-02-26 CRAN (R 4.1.0)
mada 0.5.10 2020-05-25 CRAN (R 4.1.0)
Matrix 1.3-4 2021-06-01 CRAN (R 4.1.1)
metafor 3.0-2 2021-06-09 CRAN (R 4.1.0)
mvmeta 1.0.3 2019-12-10 CRAN (R 4.1.0)
mvtnorm 1.1-2 2021-06-07 CRAN (R 4.1.0)
nlme 3.1-152 2021-02-04 CRAN (R 4.1.1)
pander 0.6.4 2021-06-13 CRAN (R 4.1.0)
papaja 0.1.0.9997 2021-10-11 Github ()
plotly 4.10.0 2021-10-09 CRAN (R 4.1.0)
plyr 1.8.6 2020-03-03 CRAN (R 4.1.0)
psych 2.1.9 2021-09-22 CRAN (R 4.1.0)
purrr 0.3.4 2020-04-17 CRAN (R 4.1.0)
RColorBrewer 1.1-3 2022-04-03 CRAN (R 4.1.2)
Rcpp 1.0.8.3 2022-03-17 CRAN (R 4.1.2)
readxl 1.3.1 2019-03-13 CRAN (R 4.1.0)
remedy 0.1.0 2018-12-03 CRAN (R 4.1.0)
reshape 0.8.8 2018-10-23 CRAN (R 4.1.0)
reshape2 1.4.4 2020-04-09 CRAN (R 4.1.0)
rmarkdown 2.11 2021-09-14 CRAN (R 4.1.1)
sessioninfo 1.1.1 2018-11-05 CRAN (R 4.1.0)
stringi 1.7.6 2021-11-29 CRAN (R 4.1.0)
stringr 1.4.0 2019-02-10 CRAN (R 4.1.0)
survival 3.2-12 2021-08-13 CRAN (R 4.1.1)
tibble 3.1.7 2022-05-03 CRAN (R 4.1.1)
tidyr 1.2.0 2022-02-01 CRAN (R 4.1.2)
usethis 2.0.1 2021-02-10 CRAN (R 4.1.0)

Full Session Info (including loaded but unattached packages — for troubleshooting only)

R version 4.1.1 (2021-08-10)

Platform: x86_64-apple-darwin17.0 (64-bit)

locale: en_US.UTF-8||en_US.UTF-8||en_US.UTF-8||C||en_US.UTF-8||en_US.UTF-8

attached base packages:

  • grid
  • stats
  • graphics
  • grDevices
  • datasets
  • utils
  • methods
  • base

other attached packages:

  • reshape(v.0.8.8)
  • readxl(v.1.3.1)
  • dygraphs(v.1.1.1.6)
  • metafor(v.3.0-2)
  • purrr(v.0.3.4)
  • lubridate(v.1.7.10)
  • reshape2(v.1.4.4)
  • stringi(v.1.7.6)
  • stringr(v.1.4.0)
  • papaja(v.0.1.0.9997)
  • kableExtra(v.1.3.4)
  • Hmisc(v.4.5-0)
  • Formula(v.1.2-4)
  • survival(v.3.2-12)
  • lattice(v.0.20-44)
  • tidyr(v.1.2.0)
  • dplyr(v.1.0.9)
  • plyr(v.1.8.6)
  • data.table(v.1.14.0)
  • mada(v.0.5.10)
  • mvmeta(v.1.0.3)
  • ellipse(v.0.4.2)
  • mvtnorm(v.1.1-2)
  • devtools(v.2.4.2)
  • usethis(v.2.0.1)
  • pander(v.0.6.4)
  • tibble(v.3.1.7)
  • sessioninfo(v.1.1.1)
  • gtsummary(v.1.4.2)
  • jtools(v.2.1.4)
  • nlme(v.3.1-152)
  • lme4(v.1.1-29)
  • Matrix(v.1.3-4)
  • ggpattern(v.0.2.0)
  • gridExtra(v.2.3)
  • plotly(v.4.10.0)
  • RColorBrewer(v.1.1-3)
  • haven(v.2.4.3)
  • ggthemes(v.4.2.4)
  • ggplot2(v.3.3.6)
  • psych(v.2.1.9)
  • brms(v.2.16.1)
  • Rcpp(v.1.0.8.3)
  • bookdown(v.0.24)
  • remedy(v.0.1.0)
  • knitr(v.1.39)
  • rmarkdown(v.2.11)

loaded via a namespace (and not attached):

  • estimability(v.1.3)
  • msm(v.1.6.9)
  • coda(v.0.19-4)
  • multcomp(v.1.4-18)
  • rpart(v.4.1-15)
  • inline(v.0.3.19)
  • generics(v.0.1.2)
  • callr(v.3.7.0)
  • TH.data(v.1.1-0)
  • proxy(v.0.4-26)
  • chron(v.2.3-56)
  • tzdb(v.0.1.2)
  • webshot(v.0.5.2)
  • xml2(v.1.3.2)
  • httpuv(v.1.6.3)
  • StanHeaders(v.2.21.0-7)
  • assertthat(v.0.2.1)
  • xfun(v.0.30)
  • hms(v.1.1.1)
  • jquerylib(v.0.1.4)
  • bayesplot(v.1.8.1)
  • evaluate(v.0.15)
  • promises(v.1.2.0.1)
  • fansi(v.1.0.3)
  • igraph(v.1.2.6)
  • DBI(v.1.1.1)
  • tmvnsim(v.1.0-2)
  • htmlwidgets(v.1.5.4)
  • horst(v.0.1)
  • tensorA(v.0.36.2)
  • stats4(v.4.1.1)
  • ellipsis(v.0.3.2)
  • crosstalk(v.1.1.1)
  • backports(v.1.4.1)
  • V8(v.3.4.2)
  • insight(v.0.17.0)
  • markdown(v.1.1)
  • RcppParallel(v.5.1.4)
  • vctrs(v.0.4.1)
  • remotes(v.2.4.0)
  • sjlabelled(v.1.1.8)
  • abind(v.1.4-5)
  • cachem(v.1.0.6)
  • withr(v.2.5.0)
  • checkmate(v.2.0.0)
  • emmeans(v.1.6.3)
  • xts(v.0.12.1)
  • prettyunits(v.1.1.1)
  • mnormt(v.2.0.2)
  • svglite(v.2.0.0)
  • cluster(v.2.1.2)
  • lazyeval(v.0.2.2)
  • crayon(v.1.5.1)
  • labeling(v.0.4.2)
  • pkgconfig(v.2.0.3)
  • pkgload(v.1.2.4)
  • nnet(v.7.3-16)
  • rlang(v.1.0.2)
  • lifecycle(v.1.0.1)
  • miniUI(v.0.1.1.1)
  • colourpicker(v.1.1.0)
  • sandwich(v.3.0-1)
  • polycor(v.0.7-10)
  • mathjaxr(v.1.4-0)
  • modelr(v.0.1.8)
  • cellranger(v.1.1.0)
  • distributional(v.0.2.2)
  • rprojroot(v.2.0.3)
  • matrixStats(v.0.60.1)
  • datawizard(v.0.4.0)
  • loo(v.2.4.1)
  • boot(v.1.3-28)
  • zoo(v.1.8-9)
  • base64enc(v.0.1-3)
  • gamm4(v.0.2-6)
  • ggridges(v.0.5.3)
  • processx(v.3.5.3)
  • png(v.0.1-7)
  • viridisLite(v.0.4.0)
  • parameters(v.0.17.0)
  • rootSolve(v.1.8.2.2)
  • readr(v.2.0.2)
  • jpeg(v.0.1-9)
  • shinystan(v.2.5.0)
  • ggeffects(v.1.1.1)
  • scales(v.1.2.0)
  • memoise(v.2.0.0)
  • magrittr(v.2.0.3)
  • threejs(v.0.3.3)
  • compiler(v.4.1.1)
  • rstantools(v.2.1.1)
  • snakecase(v.0.11.0)
  • cli(v.3.3.0)
  • ps(v.1.7.0)
  • Brobdingnag(v.1.2-6)
  • htmlTable(v.2.2.1)
  • MASS(v.7.3-54)
  • mgcv(v.1.8-36)
  • tidyselect(v.1.1.2)
  • forcats(v.0.5.1)
  • mixmeta(v.1.1.3)
  • projpred(v.2.0.2)
  • highr(v.0.9)
  • yaml(v.2.3.5)
  • latticeExtra(v.0.6-29)
  • bridgesampling(v.1.1-2)
  • sass(v.0.4.0)
  • tools(v.4.1.1)
  • lmom(v.2.8)
  • parallel(v.4.1.1)
  • rstudioapi(v.0.13)
  • foreign(v.0.8-81)
  • gld(v.2.6.2)
  • posterior(v.1.1.0)
  • farver(v.2.1.0)
  • sjPlot(v.2.8.9)
  • digest(v.0.6.29)
  • shiny(v.1.6.0)
  • broom(v.0.8.0.9000)
  • performance(v.0.9.0)
  • later(v.1.3.0)
  • httr(v.1.4.2)
  • rsconnect(v.0.8.24)
  • effectsize(v.0.6.0.1)
  • sjstats(v.0.18.1)
  • colorspace(v.2.0-3)
  • rvest(v.1.0.1)
  • brio(v.1.1.3)
  • fs(v.1.5.0)
  • splines(v.4.1.1)
  • Scale(v.1.0.4)
  • rematch2(v.2.1.2)
  • expm(v.0.999-6)
  • ltm(v.1.1-1)
  • Exact(v.3.0)
  • renv(v.0.14.0)
  • shinythemes(v.1.2.0)
  • systemfonts(v.1.0.2)
  • xtable(v.1.8-4)
  • jsonlite(v.1.8.0)
  • nloptr(v.1.2.2.2)
  • rstan(v.2.21.2)
  • testthat(v.3.1.4)
  • nFactors(v.2.4.1)
  • gt(v.0.3.1)
  • R6(v.2.5.1)
  • pillar(v.1.7.0)
  • htmltools(v.0.5.2)
  • mime(v.0.12)
  • glue(v.1.6.2)
  • fastmap(v.1.1.0)
  • minqa(v.1.2.4)
  • DT(v.0.19)
  • class(v.7.3-19)
  • codetools(v.0.2-18)
  • pkgbuild(v.1.2.0)
  • utf8(v.1.2.2)
  • bslib(v.0.3.0)
  • curl(v.4.3.2)
  • DescTools(v.0.99.43)
  • gtools(v.3.9.2)
  • shinyjs(v.2.0.0)
  • desc(v.1.4.1)
  • munsell(v.0.5.0)
  • e1071(v.1.7-9)
  • broom.helpers(v.1.4.0)
  • sjmisc(v.2.8.7)
  • gtable(v.0.3.0)
  • bayestestR(v.0.12.1)